package com.rxyb.wechat.utils;

import com.rxyb.wechat.utils.bean.WechatNewsEntity;
import com.rxyb.wechat.utils.bean.WechatNewsVo;

import java.util.Date;
import java.util.List;

/**
 * 图文消息
 *
 * @coder duyh,@auth duyh
 * @date May 18, 2020
 */
public class ImageNewsUtils {

    /**
     * 初始化图文消息
     */
    public static WechatNewsEntity initWechatNewsEntity(List<WechatNewsVo> newsList) {
        WechatNewsEntity newsMessage = new WechatNewsEntity();
        // 组建一条图文↓ ↓ ↓
        newsMessage.setCreateTime(new Date().getTime());
        newsMessage.setMsgType("news");
        newsMessage.setArticles(newsList);
        newsMessage.setArticleCount(newsList.size());
        return newsMessage;
    }

}
